package game.controller.mediator
{
	import game.GlobalConfig;
	import game.controller.mediator.base.BaseMediator;
	import game.model.GameData;
	import game.model.type.Enum;
	import game.model.type.NoticeCMD;
	import game.view.panel.game.GamePanel;
	public class GameMediator extends BaseMediator
	{
		public function GameMediator(viewComponent:Object)
		{
			super(viewComponent);
		}
		override protected function createHandlerMap():void
		{
			super.createHandlerMap();
			bindHandler(NoticeCMD.NOTICE_Index,loginIndex);
			bindHandler(NoticeCMD.NOTICE_DrawResult_RP,DrawResult_RP);
			bindHandler(NoticeCMD.NOTICE_FailChoose,FailChoose);
			bindHandler(NoticeCMD.NOTICE_UpdLevelInfo,UpdLevelInfo);
		}
		
		
		private function get view():GamePanel
		{
			return viewComponent as GamePanel;
		}
		override public function onRegister():void
		{
			super.onRegister();
			//
		
		}
		private function DrawResult_RP(data:Object):void{
			view.DrawResult(data);
		}
		private function UpdLevelInfo(data:Object=null):void{
			view.UpdLevelInfo(data);
		}
		private function loginIndex(data:Object=null):void{
			view.loginPanel();
		}
		private function FailChoose(data:Object=null):void{
			view.FailChoose();
		}
		override public function dispose():void
		{
			super.dispose();
			trace("GameMediator dispose");
		}
	}
}